#!/usr/bin/env python
# -*- coding: utf-8 -*-

# JRi some test about python.

import libgpdonkey
import libutils
import os
import stat
from datetime import datetime

day=2

file="TEMPED2K"
URL="http://www.elitefreak.net"



if os.path.exists(file):
	time=os.stat(file)
	t_time=time[stat.ST_CTIME]
	d=datetime.fromtimestamp(t_time)
	print d
	print "Exist! date :",d
    
else:
    libgpdonkey = libgpdonkey.gpdonkey()
    html = libgpdonkey.gethtml(URL)
    links = libgpdonkey.parsehtml(html)
    ed2klinks = libgpdonkey.parsed2k(links)
    libgpdonkey.createfitxer(ed2klinks)

ut = libutils.utils()

cmd="uptime"



print "Work done"
print ut.fechahui()
